package com.scwatch.ext.quartz;

import com.scwatch.common.util.Dates;
import com.scwatch.core.service.FlashBigNewService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

/**
 * 快讯新闻定时更新
 * Created by gjl 2017-07-26
 */
public class FlashNewJob  implements Job{

    private static final Logger logger = LoggerFactory.getLogger(FlashNewJob.class);
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println("当前时间："+ Dates.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        Integer sourceNodeId=(Integer) context.getJobDetail().getJobDataMap().get("sourceNodeId");
        Integer targetNodeId=(Integer) context.getJobDetail().getJobDataMap().get("targetNodeId");
        FlashBigNewService flashBigNewService=(FlashBigNewService) context.getJobDetail().getJobDataMap().get("flashBigNewService");
//        flashBigNewService.add(sourceNodeId,targetNodeId);
        logger.info("run over");
    }
}
